package ooday02;

/**
 * 方法重写的测试类
 */
public class OverrideDemo {
    public static void main(String[] args) {
//重写方法被调用时，看对象的类型来执行方法（new谁就调用谁）
        Student zg = new Student("张光", 22, "长沙",
                "jsd2407"
                , "001");
        zg.sayHi();
        Teacher ll = new Teacher("李林", 23, "湘潭",
                13000.0);
        ll.sayHi();
        Doctor zl = new Doctor("张亮", 46, "武汉",
                "普外科医生");
        zl.sayHi();
        final int a = 1;
        System.out.println(a);
    }
}
